package com.dream.common.exception;


import com.dream.common.constans.ErrorCode;

/**
 * http 响应 错误码异常
 */
public class RespErrorException extends RuntimeException {

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public RespErrorException(String message) {
        super(message);
    }

    public RespErrorException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public RespErrorException(String message, Throwable cause) {
        super(message, cause);
    }

    public RespErrorException(Throwable cause) {
        super(cause);
    }

    public RespErrorException(ErrorCode errorCode) {
        super(errorCode.msg);
        this.code = errorCode.code;
    }

}
